import { Controller, Get, Post, Body, Patch, Param, Delete, UseInterceptors, ClassSerializerInterceptor } from '@nestjs/common';
import { Aaa6Service } from './aaa6.service';
import { CreateAaa6Dto } from './dto/create-aaa6.dto';
import { UpdateAaa6Dto } from './dto/update-aaa6.dto';
import { ClassSerializerInterceptor2 } from '../class-serializer.interceptor';
import { SerizalizeOptions } from '../serizalize-options.decorator';

@Controller('aaa6')
export class Aaa6Controller {
  constructor(private readonly aaa6Service: Aaa6Service) {}

  @Post()
  create(@Body() createAaa6Dto: CreateAaa6Dto) {
    return this.aaa6Service.create(createAaa6Dto);
  }

  @SerizalizeOptions({
    strategy: 'exposeAll'
  })
  @UseInterceptors(ClassSerializerInterceptor2)
  @Get()
  findAll() {
    return this.aaa6Service.findAll();
  }

  @UseInterceptors(ClassSerializerInterceptor2)
  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.aaa6Service.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateAaa6Dto: UpdateAaa6Dto) {
    return this.aaa6Service.update(+id, updateAaa6Dto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.aaa6Service.remove(+id);
  }
}
